home *** CD-ROM | disk | FTP | other *** search
/ Pirate Informatique 34 / Pirate infomatique No34.iso / js / tabs.js < prev    next >
Text File  |  2011-09-15  |  731b  |  28 lines

  1. /* ------------------------------------------------------------------------
  2.     Do it when you're ready dawg!
  3. ------------------------------------------------------------------------- */
  4.  
  5.     
  6.  
  7.     tabs = {
  8.   init : function(){
  9.    $('.tabs').each(function(){
  10.  
  11.     var th=$(this),
  12.      tContent=$('.tab-content',th),
  13.      navA=$('.nav a',th)
  14.  
  15.     tContent.not(tContent.eq(0)).hide()
  16.  
  17.     navA.click(function(){
  18.          var th=$(this),
  19.           tmp=th.attr('href')
  20.          tContent.not($(tmp.slice(tmp.indexOf('#'))).fadeIn(1000)).hide()
  21.          $(th).parent().addClass('selected').siblings().removeClass('selected').find('span').stop().animate({opacity:'0'},600);
  22.          Cufon.refresh();
  23.         return false;
  24.     });
  25.    });
  26.  
  27.   }
  28.  }